<?php

namespace Modules\Goods\Entities;

use Encore\Admin\Traits\ModelTree;
use Encore\Admin\Traits\AdminBuilder;
use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    use ModelTree, AdminBuilder;

    protected $fillable = [];

    protected $casts = [
        'parent_id' => 'integer',
        'order' => 'integer',
        'display' => 'boolean',
    ];

    // 获取团购商品
    public function goods()
    {
        return $this->hasMany(Goods::class);
    }
}
